1. Field of the Invention
The present invention relates to a method of and an apparatus for extracting image data representing a desired part of a whole image out of total image data representing the whole image.
2. Description of the Related Art
Image processors these days have a function to electronically perform various types of image processings. In some cases, only a part of an image (hereinafter referred to as partial image) is subjected to image processing such as image combining. Such partial image processing will be executed by the steps of: extracting partial image data representing the partial image out of total image data of the whole image, and performing the desired image processing on the partial image data.
When the total image data is of run-length data type, the partial image data is extracted from the total run-length data of the whole image as follows: FIG. 1 is a conceptive view illustrating an example of an image IM including a partial image PI to be extracted. The image IM is represented by run-length data, whose structure is shown in FIG. 2. The image IM of FIG. 1 is represented by run-length length data Dr1, Dr2, . . . , and Dri, as shown in FIG. 2, of respective scanning lines L1, L2, . . . , and Li in a main scanning direction Y.
As shown in FIG. 2, run-length data on a certain scanning line usually consists of plural units of run-length data. For example, first run-length data Dr1 includes three run-length data units Dr1(1), Dr1(2), and Dr1(3). These plural run-length data units Dr1(1), Dr1(2), and Dr1(3) respectively represent run lengths of the different colors of an image fragment on the scanning line L1, for example, white/black/white. In this specification, "black" and "white" are dealt with as different colors.
Extraction of run-length data representing the partial image PI shown in FIG. 1 will be performed by the steps of: successively reading out run-length data units from the first unit Dr1(1) to retrieve a particular data unit representing a first pixel Pi of the partial image PI; and extracting run-length data units covering the first pixel Pi to a last pixel Pe of the partial image PI.
The conventional image processing system, which reads out run-length data in sequences from the beginning of the total run-length image data, consumes rather a long time to find the run-length data representing the partial image. Any image processing on the partial image therefore requires the preceding data retrieval, which increases the total processing time undesirably.